package com.wxtt.android.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.fast.dev.frame.utils.LogUtils;
import com.wxtt.android.config.SpConfig;

import cn.bmob.push.PushConstants;

/**
 * 说明：Bmob消息推送接收器
 * <p/>
 * 作者：fanly
 * <p/>
 * 时间：2016/3/2 14:02
 * <p/>
 * 版本：verson 1.0
 */
public class PushReceiver extends BroadcastReceiver{

    private HandlerPushMessage mHanlder = HandlerPushMessage.get();

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(PushConstants.ACTION_MESSAGE)){
            String message = intent.getStringExtra(PushConstants.EXTRA_PUSH_MESSAGE_STRING);
            if (SpConfig.isPushState()){
                mHanlder.message(message);
                LogUtils.json(message);
            }
        }
    }

}
